package com.tw;

/**
 * Created by admin on 16/06/14.
 */


public class Fifth {
    public static void main(String[] args) {
        int n = 3;
        Fifth f = new Fifth();
        f.generateIsoscelesTriangle(3, 0);

    }

    private void generateIsoscelesTriangle(int n, int verticalOffset) {
        int i, j;
        int RowStars = 1;
        for (i = n; i > 0; i--, RowStars += 2) {
            for (j = 0; j < i - 1 + verticalOffset; j++) {
                System.out.printf(" ");
            }
            for (j = 0; j < RowStars; j++) {
                System.out.print("*");
            }
            System.out.printf("\n");
        }

    }
}